<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <head th:replace="common/common_css :: css(~{::link})">
    </head>
    <title>药库管理</title>
   <!-- <script src="//code.jquery.com/jquery-1.11.0.min.js"></script>-->
    <script type="text/javascript" th:src="@{/js/jquery-3.3.1.min.js}"></script>
    <link rel="stylesheet" type="text/css" th:href="@{/css/chosen.min.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{css/mcss/model/component.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{css/mcss/mcss_drugManage.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/css/flatpickr.min.css}"/>
    <link type="text/css" rel="stylesheet" th:href="@{/css/preloader.css}">
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>

<div id="preloader">
    <div id="preloader-inner"></div>
</div>
<div id="wrapper">
    <div th:replace="common/common_left :: left"></div>

    <div id="content-wrapper" class="d-flex flex-column content-wrapper">
        <div id="content">
            <div th:replace="common/common_head :: head"></div>

            <!--正文-->
            <div>
                <!--card shadow mb-4-->
                <div class="" style="margin-left: 2.5%;height: 818px">

                    <div class="card-header py-3">
                        <h6 class="m-0 font-weight-bold text-primary">药库管理</h6>
                    </div>

                    <div class="card-body">
                        <div style=" margin-left: 1%;margin-right: 1%">

                            <!--搜索框-->
                            <span>
                            <form id="getSelectInfo">
                            <div class="drug_search">
                                <div class="one" style="margin-left: 25px">
                                    <d style="float:left">药品名&nbsp;</d>
                                    <select id="selectdrugsname" name="selectdrugsname" class="drugSelect"  data-placeholder=' ---- 选择药品名 ----'style="width: 100px;">
                                        <option value="0"></option>

                                    </select>
                                </div>

                                <div class="two" style="margin-left: 25px">
                                    剂型
                                    <select id="selectdrugsReagent" name="selectdrugsReagent" class='drugTypeSelect_search' data-placeholder=' '>
                                        <option ></option>

                                    </select>
                                </div>

                                <div class="three" style="margin-left: 25px; ">
                                    是否限制药
                                    <select style="width: 150px;height: 10px" id="selectLimit" name="selectLimit" class='limitStatus_search' data-placeholder=' ' >
                                        <option value="2">选择限制类型</option>
                                        <option value="1">是</option>
                                        <option value="0">否</option>
                                    </select>
                                </div>

                                <div  class="four" style="margin-left: 25px">
                                    <d style="float:left">功效&nbsp;</d>

                                    <select style="float:left;width: 120px;" id="selectdrugsFunction" name="selectdrugsFunction" class='efficacyClassificationSelect_search' data-placeholder=' '>
                                        <option ></option>

                                    </select>
                                </div>

                                <div class="five" style="margin-left: 25px">
                                    <button class="btn btn-info" onclick="searchDrug()">
                                        <img class="png" th:src="@{/images/icon/search.png}">
                                    </button>
                                </div>
                            </div>
                            </form>
                            </span>

                            <div class="fixed-table-container fixed-height" style="height: 456.444px; padding-bottom: 49px;">
                                <div class="fixed-table-header" style="margin-right: 19px;">

                                <div class="fixed-table-body">
                                    <div class="fixed-table-loading table table-bordered table-hover fixed-table-border" style="top: 50px; display: none; width: 1207.94px;">
        <span class="loading-wrap">
        <span class="loading-text">正在努力地加载数据中，请稍候</span>
        <span class="animation-wrap"><span class="animation-dot"></span></span>
        </span>
                                    </div>
                                    <div>

                                    <!--table-->
                                    <table class="table table-bordered table-hover" style="margin-top: -49px;">
                                         <th style="text-align: center; vertical-align: middle; " data-field="num">
                                        <div class="th-inner ">序号</div><div class="fht-cell"></div></th>
                                        <th style="text-align: center; vertical-align: middle; " data-field="num">
                                        <div class="th-inner ">药品编号</div><div class="fht-cell"></div></th>
                                        <th style="text-align: center; vertical-align: middle; " data-field="name">
                                        <div class="th-inner ">药品名</div><div class="fht-cell"></div></th>
                                        <th style="text-align: center; vertical-align: middle; " data-field="drugType">
                                        <div class="th-inner ">剂型</div><div class="fht-cell"></div></th>
                                        <th style="text-align: center; vertical-align: middle; " data-field="specification">
                                        <div class="th-inner ">规格</div><div class="fht-cell"></div></th>
                                        <th style="text-align: center; vertical-align: middle; " data-field="unit">
                                        <div class="th-inner ">规格单位</div><div class="fht-cell"></div></th>
                                        <th style="text-align: center; vertical-align: middle; " data-field="limitStatus">
                                        <div class="th-inner ">是否限制药</div>
                                        <!--<th style="text-align: center; vertical-align: middle; " data-field="limitStatus">
                                        <div class="fht-cell"></div></th>-->
                                        <th style="text-align: center; vertical-align: middle; " data-field="efficacyClassification">
                                            <div class="th-inner ">功效</div><div class="fht-cell"></div></th>
                                        <th style="text-align: center; vertical-align: middle; " data-field="wholesalePrice">
                                            <div class="th-inner ">批发价</div><div class="fht-cell"></div></th>
                                        <th style="text-align: center; vertical-align: middle; " data-field="price">
                                            <div class="th-inner ">售价</div><div class="fht-cell"></div></th>
                                        <th style="text-align: center; vertical-align: middle; " data-field="manufacturer">
                                            <div class="th-inner ">生产厂家</div><div class="fht-cell"></div></th>
                                        <th style="text-align: center; vertical-align: middle; " data-field="storageQuantity">
                                            <div class="th-inner ">库存量</div>
                                            <div class="fht-cell"></div></th><th style="text-align: center; vertical-align: middle; " data-field="productionDate">
                                            <div class="th-inner ">生产日期</div><div class="fht-cell"></div></th><th style="text-align: center; vertical-align: middle; " data-field="qualityDate">
                                            <div class="th-inner ">保质日期</div><div class="fht-cell"></div></th><th style="text-align: center; " data-field="operation">
                                            <div class="th-inner ">操作</div><div class="fht-cell"></div></th>

                                        <tr th:each="drug : ${pageInfo.list}" data-index="${drugStat.index+1}">
                                            <td style="text-align: center; vertical-align: middle; " th:text="${drugStat.index+1}" >x</td>
                                            <td style="text-align: center; vertical-align: middle; " id="drugsIdInform" th:text="${drug.id}" th:value="${drug.id}">x</td>
                                            <td style="text-align: center; vertical-align: middle; " th:text="${drug.name} " th:value="${drug.name}">x</td>
                                            <td style="text-align: center; vertical-align: middle; " th:text="${drug.drugType}" th:value="${drug.drugType}">胶囊剂</td>
                                            <td style="text-align: center; vertical-align: middle; " th:text="${drug.specification}" th:value="${drug.specification}">0.3g*10</td>
                                            <td style="text-align: center; vertical-align: middle; " th:text="${drug.unit}" th:value="${drug.unit}">板</td>
                                            <td style="text-align: center; vertical-align: middle; " th:text="${drug.limitStatus}" th:value="${drug.limitStatus}">否</td>
                                            <td style="text-align: center; vertical-align: middle; " th:text="${drug.efficacyClassification}" th:value="${drug.efficacyClassification}">解热镇痛</td>
                                            <td style="text-align: center; vertical-align: middle; " th:text="${drug.wholesalePrice}" th:value="${drug.wholesalePrice}">180.4</td>
                                            <td style="text-align: center; vertical-align: middle; " th:text="${drug.price}" th:value="${drug.price}">184.0</td>
                                            <td style="text-align: center; vertical-align: middle; " th:text="${drug.manufacturer}" th:value="${drug.manufacturer}">四川公司</td>
                                            <td style="text-align: center; vertical-align: middle; " th:text="${drug.storageQuantity}" th:value="${drug.storageQuantity}">30</td>
                                            <td style="text-align: center; vertical-align: middle; " th:text="${#dates.format(drug.productionDate,'yyyy-MM-dd')}" th:value="${drug.productionDate}">2013-06-13 00:00:00</td>
                                            <td style="text-align: center; vertical-align: middle; "  th:text="${#dates.format(drug.qualityDate,'yyyy-MM-dd')}" th:value="${drug.qualityDate}" >2019-06-13 00:00:00</td>


                                            <td><button id="btn_modify" name="${drugStat.index+1}" onclick="update(this)"  class="btn btn-primary" data-toggle="model" data-target="#updateDeptMd" data-orderId="${drug.getId()}" th:value="${drug.getId()}">修改</button>
                                                <button id="btn_delete"  onclick="deleteDrug(this)" class="btn  btn-outline-danger" th:value="${drug.getId()}">删除</button></td>
                                        </tr>

                                       </tbody></table>

                                        <p>当前第 <span th:text="${pageInfo.pageNum}"></span>页,总 <span th:text="${pageInfo.pages}"></span> 页,共 <span th:text="${pageInfo.total}"></span> 条记录</p>

                                        <a th:href="@{/drugs/toDrugsPages}">首页</a>
                                        <a th:href="@{/drugs/toDrugsPages(pageNum=${pageInfo.hasPreviousPage}?${pageInfo.prePage}:1)}">上一页</a>
                                        <a th:href="@{/drugs/toDrugsPages(pageNum=${pageInfo.hasNextPage}?${pageInfo.nextPage}:${pageInfo.pages})}">下一页</a>
                                        <a th:href="@{/drugs/toDrugsPages(pageNum=${pageInfo.pages})}">尾页</a>


                                        <!--修改药品的模态框-->
                                        <div class="modal" id="updateDeptMd" >
                                            <div class="modal-dialog" >
                                                <div class="modal-content">
                                                    <div class="modal-header">
                                                        <h3 class="modal-title">修改药品信息</h3>
                                                    </div>
                                                    <!--身体-->
                                                    <div class="modal-body"><!--th:action="@{/drugs/updateDrugs}" -->
                                                        <form id="updateDeptFom" class="form-horizontal"  style="width: 450px;">
                                                            <div class="form-group">
                                                                <d   >序号</d>
                                                                <div class="col-md-5">
                                                                    <input class="form-control" type="text" id="updateDeptId" name="id"   readonly/>
                                                                </div>
                                                            </div>
                                                            <div class="form-group">
                                                                <!--药品名--><d   >药品名</d>
                                                                <div class="col-md-5">
                                                                    <input class="form-control" type="text" id="updateDeptName" name="name" />
                                                                </div>
                                                            </div>
                                                            <div class="form-group">
                                                                <d   >剂型</d>
                                                                <div class="col-md-5">
                                                                    <input class="form-control"  type="text" id="drugType" name="drugType" />
                                                                </div>
                                                            </div>
                                                            <!--规格-->
                                                            <div class="form-group">
                                                                <d   >规格</d>
                                                                <div class="col-md-5">
                                                                    <input class="form-control" type="text" id="Specification" name="specification" />
                                                                </div>
                                                            </div>
                                                            <div class="form-group">
                                                                <d   >规格单位</d>
                                                                <div class="col-md-5">
                                                                    <input class="form-control" type="text" id="unit" name="unit" />
                                                                </div>
                                                            </div>
                                                            <div class="form-group">
                                                                <d   >是否限制药</d>
                                                                <div class="col-md-5">
                                                                    <input class="form-control" type="text" id="limitStatus" name="limitStatus" />
                                                                </div>
                                                            </div>
                                                            <div class="form-group">
                                                                <d   >功效</d>
                                                                <div class="col-md-5">
                                                                    <input class="form-control" type="text" id="efficacyClassification" name="efficacyClassification" />
                                                                </div>
                                                            </div>
                                                            <div class="form-group">
                                                                <d   >批发价</d>
                                                                <div class="col-md-5">
                                                                    <input class="form-control" type="text" id="wholesalePrice" name="wholesalePrice" />
                                                                </div>
                                                            </div>
                                                            <div class="form-group">
                                                                <d   >售价</d>
                                                                <div class="col-md-5">
                                                                    <input   class="form-control" type="text" id="price" name="price" />
                                                                </div>
                                                            </div>
                                                            <div class="form-group">
                                                                <d   >生产厂家</d>
                                                                <div class="col-md-6">
                                                                    <input class="form-control" type="text" id="manufacturer" name="manufacturer" SIZE="29" onmouseover="this.style.borderColor='black';this.style.backgroundColor='plum'"
                                                                           onmouseout="this.style.borderColor='black';this.style.backgroundColor='#ffffff'" />
                                                                </div>

                                                                <!--<input value="Type here" NAME="user_pass" TYPE="text" SIZE="29" onmouseover="this.style.borderColor='black';this.style.backgroundColor='plum'"
                                                                       onmouseout="this.style.borderColor='black';this.style.backgroundColor='#ffffff'" >-->
                                                            </div>
                                                            <div class="form-group">
                                                                <d   >库存量</d>
                                                            <div class="col-md-5">
                                                                    <input class="form-control" type="text" id="storageQuantity" name="storageQuantity" />
                                                                </div>
                                                            </div>

                                                            <div style="display: flex;margin-top:30px">
                                                                <div style="display: flex;width: 245px">
                                                                    <div> 生产日期</div>
                                                                    <input class="productionDate" name="productionDate" id="productionDate" style="width: 145px;height: 33px">
                                                                </div>
                                                                <div style="display: flex;width: 255px">
                                                                    <div> 保质日期</div>
                                                                    <input class="qualityDate" name="qualityDate" id="qualityDate" style="width:145px;height: 33px">
                                                                </div>
                                                            </div>

                                                            <div class="modal-footer">
                                                                <a style="text-decoration: none" th:href="@{/drugs/toDrugsPages}">
                                                                    <input type="button"  value="取消" class="btn btn-primary">
                                                                </a>
                                                                <a style="text-decoration: none">
                                                                    <button  type="submit" onclick="updateDrugs()" class="btn btn-primary">
                                                                            确认
                                                                    </button></a>
                                                             <!--   <a style="text-decoration: none" href="/drugs/updateDrugs">
                                                                <input type="button"  value="确认">
                                                                </a>-->
                                                            </div>
                                                        </form>
                                                    </div>

                                                </div>
                                            </div>
                                        </div>


                                        <div class="fixed-table-border" style="height: 0px;"></div>
                                </div>
                                </div>
                                <div class="fixed-table-footer" style="display: none;">
                                    <table><thead><tr></tr></thead>
                                    </table>
                                </div>

                            <div class="fixed-table-pagination" style="">
                                <div class="float-left pagination-detail">
        <span class="pagination-info">
        <!--显示 1 到 4 行-->
        </span>
        <span class="page-list" style="display: none;">
        <span class="btn-group dropdown dropup">
          <button class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">
        <span class="page-size">
          10
        </span>
        <span class="caret"></span>
          </button>
          <div class="dropdown-menu">
              <a class="dropdown-item active" th:href="@{#}">10</a>
          </div>
        </span> 每页行数</span>
              </div>
                                <div class="float-right pagination" style="display: none;">
              <ul class="pagination"><li class="page-item page-pre">
                  <a class="page-link" th:href="@{#}">上一页</a>
              </li><li class="page-item active">
                  <a class="page-link" th:href="@{#}">1</a></li><li class="page-item page-next">
                  <a class="page-link" th:href="@{#}">下一页</a></li></ul>
          </div>
                            </div>

                                <div class="clearfix"></div>
                                </div>
                            </div>




                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
<div>
    <div th:replace="common/common_js :: js(~{::script})"></div>

    <script type="text/javascript" th:src="@{/js/jquery.preloader.min.js}"></script>
    <script type="text/javascript" th:src="@{/js/chosen.jquery.min.js}"></script>

    <script type="text/javascript" th:src="@{js/bootstrap.js}"></script>
    <script type="text/javascript" th:src="@{/js/flatpickr.min.js}"></script>
    <script th:src="@{/sb-admin-2/bootstrap/bootstrap-table.min.js}"></script>
    <script th:src="@{/sb-admin-2/bootstrap/bootstrap-table-zh-CN.js}"></script>
    <script type="text/javascript" th:src="@{/js/mjs/mjs_drugManage.js}"></script>





</div>
</body>
<style>

    .one,.two,.three,.four,.five{

        width: 10%;

        height: 45px;

        border:0px solid #ccc;

        float: left;

        box-sizing: border-box;

    }

</style>
<script>

    //页面加载完成后
    $(function () {
        //发起ajax请求获取所有的药名信息
        var url="/drugs/findAllDrugsName";
        $.getJSON(url,function (data) {
            if(data.state==201){
                var drugsname=data.data;
                showDrugsName(drugsname);
            }
        });

        //发起ajax请求获取所有的药效果信息
        var url2="/drugs/findAllDrugsFunction";
        $.getJSON(url2,function (data) {
            if(data.state==201){
                var drugsFunction=data.data;
                showDrugsFunction(drugsFunction);
            }
        });

        //发起ajax请求获取所有的剂型信息
        var url3="/drugs/findAllDrugsReagent";
        $.getJSON(url3,function (data) {
            if(data.state==201){
                var drugsReagent=data.data;
                showDrugsReagent(drugsReagent);
            }
        });


    });

    //时间转换
    function translantionTime(time) {
        //时间
        var time2 = new Date(time).toJSON();
        var d = new Date(time2);
        //如果小于9，前面加0
        var day = ("0" + d.getDate()).slice(-2);
        //如果小于9，前面加0
        var month = ("0" + (d.getMonth() + 1)).slice(-2);
        //拼接日期
        var times=d.getFullYear() + '-' + (month) + '-' + (day);
        //时分秒拼接
        /*var times1 = times+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();*/
        return times;
    }
    //显示药品名
    function showDrugsName(drugsname) {
        $("#selectdrugsname").empty();//清空原有的数据<option>标签
        $("#selectdrugsname").html("<option value='0'>请选择药品名哦..</option>");

        var option="";
        //遍历
        for(var i=0;i<drugsname.length;i++){
            option="<option value='"+drugsname[i].name+"'>"+drugsname[i].name+"</option>";
            $("#selectdrugsname").append(option);
        };

        //将option追加到select标签下
    }

    //显示剂型
    function showDrugsReagent(drugsReagent){
        $("#selectdrugsReagent").empty();//清空原有的数据<option>标签
        $("#selectdrugsReagent").html("<option value='0'>请选择剂型哦..</option>");

        var option="";
        //遍历
        for(var i=0;i<drugsReagent.length;i++){
            option="<option value='"+drugsReagent[i].drugType+"'>"+drugsReagent[i].drugType+"</option>";
            $("#selectdrugsReagent").append(option);
        };

        //将option追加到select标签下
    }

    //显示药品效果
    function showDrugsFunction(drugsFunction) {
        $("#selectdrugsFunction").empty();//清空原有的数据<option>标签
        $("#selectdrugsFunction").html("<option value='0'>请选择药品效果哦..</option>");

        var option="";
        //遍历
        for(var i=0;i<drugsFunction.length;i++){
            option="<option value='"+drugsFunction[i].efficacyClassification+"'>"+drugsFunction[i].efficacyClassification+"</option>";
            $("#selectdrugsFunction").append(option);
        };

        //将option追加到select标签下
    }

    //触发onclick事件弹出模块框
    function update(obj){
        var id=$(obj).val();
        param={"id":id};
        $.get("/drugs/seeid", param, function (data) {
            if (data.state==201) {
                var drugs=data.data;
                editInfo(drugs);
                $("#updateDeptMd").modal('show');
            } else {
                alert(data.message);
            }
        })
    }

    //更新模态框的数据
    function editInfo(data) {
        var id =data.id;
        /*alert(data.productionDate);*/
        //向模态框中传值
        $("#updateDeptId").val(data.id);
        $("#updateDeptName").val(data.name);
        $('#drugType').val(data.drugType);
        $('#Specification').val(data.specification);
        $('#unit').val(data.unit);
        $('#limitStatus').val(data.limitStatus);
        $('#efficacyClassification').val(data.efficacyClassification);
        $('#wholesalePrice').val(data.wholesalePrice);
        $('#price').val(data.price);
        $('#manufacturer').val(data.manufacturer);
        $('#storageQuantity').val(data.storageQuantity);
       /*$('#productionDate').val(Date(data.productionDate));*/
        //时间
        var time = new Date(data.productionDate).toJSON();
        var d = new Date(time);
        //如果小于9，前面加0
        var day = ("0" + d.getDate()).slice(-2);
        //如果小于9，前面加0
        var month = ("0" + (d.getMonth() + 1)).slice(-2);
        //拼接日期
        var times=d.getFullYear() + '-' + (month) + '-' + (day);
        //时分秒拼接
        /*var times1 = times+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();*/
        $("#productionDate").val(times);

        //保质时间
        /*$('#qualityDate').val(Date(data.qualityDate));*/
        var time = new Date(data.qualityDate).toJSON();
        var d = new Date(time);
        //如果小于9，前面加0
        var day = ("0" + d.getDate()).slice(-2);
        //如果小于9，前面加0
        var month = ("0" + (d.getMonth() + 1)).slice(-2);
        //拼接日期
        var times=d.getFullYear() + '-' + (month) + '-' + (day);
        //时分秒拼接
        /*var times1 = times+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();*/
        $("#qualityDate").val(times);
    }

    //没用的
    function getupdateInfo(){
        //时间
        var createDate = $("#createDate");
        var time = new Date(data.data.createDatetime).toJSON();
        var d = new Date(time);
        //如果小于9，前面加0
        var day = ("0" + d.getDate()).slice(-2);
        //如果小于9，前面加0
        var month = ("0" + (d.getMonth() + 1)).slice(-2);
        //拼接日期
        var times=d.getFullYear() + '-' + (month) + '-' + (day);
        //时分秒拼接
        var times1 = times+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();
        //把转换的日期赋值给input
       /* alert("times1"+times1);*/
    }

        //更新药品根据模块框表单的数据
        function updateDrugs(){
        var dataw = $("#updateDeptFom").serialize();
           /* var data2=$("#updateDeptFom").attr();*/
          /* alert(dataw);*/
        param={"drug":dataw};
        // 到后台获取修改药品信息
        $.post("/drugs/updateDrugs",dataw,function(data) {
            if (data.state==201) {
                /*top.location.href = "/drugs/toDrugsPages";*/
                self.location=document.referrer;
            } else {
                alert(data.message);
            }
        })

    }
    //删除药品
    function deleteDrug(obj) {
        var id=$(obj).val();
        param={"id":id};
        $.post("/drugs/deletedrugs",param, function (data) {
            if (data.state==201) {
                alert(data.message)
                self.location=document.referrer;
            } else {
                alert(data.message);
            }
        })

    }
    //根据条件查找药品
    function  searchDrug(){
        var data=$("#getSelectInfo").serialize();
       /* alert(data);*/
        param={"selectdrugsname":selectdrugsname,"selectdrugsReagent":selectdrugsReagent,"selectLimit":selectLimit,"selectdrugsFunction":selectdrugsFunction};
        var url="/drugs/selectDrugsLimit";
        /* var url="/address/saveAddress2";*/
        $.getJSON(url,data,function (data) {
            if(data.state==201){
                alert(data.message);
                location.href = "/drugs/updateModel"
            }else{
                alert(data.message);
            }
        })
    }
   /* $(document).ready(function() {
        $("[id=btn_modify]").click(function (id) {


            alert("name:"+name);
     /!*           $.post("/drugs/seeid", id2, function (data) {
                    if (data.state == 200) {
                        alert(data.message);
                        location.href = "/admin/toMain";
                    } else {
                        alert(data.message);
                    }
                })*!/
            $("#updateDeptMd").modal('show');
        })

    });*/

/*  function updateDpet() {
        // 初始化部门修改信息下拉列表
        $('#updateDeptMd').on('show.bs.modal',function (e) {
            var id = $(e.relatedTarget).data('id'); //根据上面a标签中传递的data-orderid取值,这里也可以通过data-id取值
            alert(id);
            //var data =  $('#updateDeptMd').data(); 也可以直接取data对象再取值
            console.log(id);

            // 到后台获取部门信息
            $.post("/drugs/seeid",id, function (data) {
                if (data !=0) {
                    alert("ok");
                    location.href = "/admin/toMain";
                } else {
                    alert(data.message);
                }
            })
            $("#updateDeptMd").modal('show');
        });}*/



</script>
</html>